<template>
    <h3>parent</h3>
    <hr>
    <Child :count="conut" :str="str" />
    <hr>
    <Son @sendData="sendData" />
    <div>
        <div>子组件传的值Snum:{{ Snum }}</div>
        <div>子组件传的值Smsg:{{ Smsg }}</div>
    </div>
    <hr>
    <Event/>
</template>
<script setup lang='ts'>
import Child from "./Child.vue";
import Son from "./Son.vue";
import Event from "./Event.vue";
import { ref, reactive } from 'vue'
const conut = ref(10)
const str = ref<string>('hello ts')
const Snum = ref()
const Smsg = ref('23432')

//接受子组件传递的参数
const sendData = (num: number, msg: string) => {
    console.log(num, msg);
    Snum.value = num;
    Smsg.value = msg;
}
</script>
<style scoped lang='scss'></style>